<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-3.3.1.js"></script>
    <style>
        .block{
            position: relative;
            border: 1px solid black;
            width: 100px;
            height: 100px;
            background-color: blueviolet;
        }
    </style>
</head>
<body>
    <button id="left">«</button> <button id="right">»</button>
    <div class="block"></div>
    <script>
        $("#right").click(function(){
        $(".block").animate({left: '+50px'}, "slow");
        });

        $("#left").click(function(){
        $(".block").animate({left: '-50px'}, "slow");
        });
    </script>
</body>
</html>